<div class="grid_7">
    <div class="box">
        <h2>
            <a href="#" id="toggle-tables">CITY MANAGEMENT</a>
        </h2>
        <div class="block" >
            <form name="admin-form" action="<?= base_url(); ?>admin/location/city_insert" method="post">
                <fieldset>
                    <legend>CITY : NEW </legend>
                    <?php
                    if ($this->session->flashdata('message')) {
                        $msg = $this->session->flashdata('message');
                        echo '<font color="red">' . $msg . '</font>';
                    }
                    ?> 
                    <div class="field">
                        <label> City Name</label>
                        <input type="text" size="50" name="city" onfocus="if(this.value=='Enter City')this.value='';" 
                               onblur="if(this.value=='')this.value='Enter City';" value="Enter City" />
                        <input type="hidden" name="country_id" value="<?= $country_id; ?>" />
                        <input type="hidden" name="state_id" value="<?= $state_id; ?>" />
                        <input type="submit" value="Add City" name="insert" />
                    </div>

                </fieldset>
            </form>
        </div>
    </div> <!-- END OF BOX -->

    <div class="box">
        <h2>
            <a href="#" id="toggle-tables">CITY LIST : <?= $this->location_model->get_state_name($state_id); ?></a>
        </h2>

        <div class="block" >
            <fieldset>
                <legend>List :</legend>
                <?php foreach ($city as $city): ?>
                    <form name="update_make" action="<?= base_url(); ?>admin/location/city_update" method="post">
                        <div class="field">
                            <input type="hidden" size="10" name="city_id" value="<?= $city->id; ?>" />
                            <input type="hidden" size="10" name="state_id" value="<?= $city->state_id; ?>" />
                            <input type="hidden" size="10" name="country_id" value="<?= $city->country_id; ?>" />
                            <input type="text" size="50" name="city_detail" value="<?= $city->city; ?>" />
                            <input type="submit" value="Update" name="update_city" />
                            <div id="link-button" style="float: right">
                                <a href="<?= base_url(); ?>admin/location/city_delete/<?= $city->country_id; ?>/<?= $city->state_id; ?>/<?= $city->id; ?>" class="link-button"> Delete </a>
                                <!--<a href="<?= base_url(); ?>admin/management/car_model/<?= $state->id; ?>" class="link-button"> View City </a>-->
                            </div>
                        </div>
                    </form>
                <?php endforeach; ?>

            </fieldset>

        </div>

        <div class="pagination" align="left"> <?php echo $this->pagination->create_links(); ?>  </div>
    </div> <!-- END OF BOX -->


</div>
